cmake_minimum_required ( VERSION 3.10 )
project ( MessageProject )

# 创建对象库
add_library ( MessageObj OBJECT
    Message.hpp
    Message.cpp
)

# 创建可执行文件并链接对象库
add_executable ( main_exe
    hello-world.cpp
    $<TARGET_OBJECTS:MessageObj>
)

# 设置包含目录
target_include_directories ( MessageObj
    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)